using System;
using Migrator;

namespace MRBase.Migrations
{
	/// <summary>
	/// Add User table to the database
	/// </summary>
	[Migration(1)]
	public class AddUserTable : Migration
	{
		public override void Up()
		{
			Database.AddTable("User",
				new Column("Id", typeof(int), ColumnProperties.PrimaryKeyWithIdentity),
				new Column("Name", typeof(string), 50),
				new Column("Username", typeof(string), 50),
				new Column("Email", typeof(string), 50),
				new Column("Password", typeof(string), 50),
				new Column("LastLoginDate", typeof(string), 50),
				new Column("LastLockoutDate", typeof(string), 50),
				new Column("CreationDate", typeof(string), 50),
				new Column("IsApproved", typeof(string), 50),
				new Column("IsLocked", typeof(string), 50),
				new Column("ApplicationId", typeof(string), 50)
			);
		}
		
		public override void Down()
		{
			Database.RemoveTable("User");
		}
		
	}
}
